package cn.wf.spi;

import java.util.ServiceLoader;

/**
 * @author wangfei
 * @date 2024/3/3 3:55 下午
 */
public class SearchDoc {
    public static void main(String[] args) {
        new SearchDoc().searchDocByKeyWord("hello world");
    }

    private void searchDocByKeyWord(String keyWord) {
        ServiceLoader<Search> searchServiceLoader = ServiceLoader.load(Search.class);
        for (Search search : searchServiceLoader) {
            System.out.println(search.searchDoc(keyWord));
        }
    }
}
